<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="description" content="">
    <meta name="author" content="">

    <title>创新空间</title>

      <!-- Bootstrap Core CSS -->
    <link href="__PUBLIC__/assest/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom CSS -->
    <link href="__PUBLIC__/assest/css/landing-page.css" rel="stylesheet">

    <!-- Custom Fonts -->
    <link href="__PUBLIC__/assest/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="https://fonts.googleapis.com/css?family=Lato:300,400,700,300italic,400italic,700italic" rel="stylesheet" type="text/css">
	
	 <link href="__PUBLIC__/assets/css/bootstrap.min.css" rel="stylesheet">

    <!-- Custom styles for this template -->
    <link href="__PUBLIC__/assets/css/dashboard.css" rel="stylesheet">
	
	  <link href="http://libs.baidu.com/bootstrap/3.0.3/css/bootstrap.min.css" rel="stylesheet">
   <script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>
   <script src="http://libs.baidu.com/bootstrap/3.0.3/js/bootstrap.min.js"></script>
   <style>
    #pageButton{
			width:80%;
			margin-left:10%;
	   }
	   #left{
			width:50%;
			
	   }
	   #right{
			width:50%;
			margin-left:50%;
			
	   }
	</style>
	<script>
	 	var istrue=false;
		function test(){
			var s1=document.getElementById("pwd").value;
			var s2=document.getElementById("rpwd").value;
			var s3 =document.getElementById("clogodiv");
			if(s1!=s2){
			s3.innerHTML="错误";
			alert("两次密码输入不一致！");
			s3.style.color="red";
			istrue=false;
			}else if(s1!="" && s1==s2){
			 s3.style.color="blue";
			  s3.innerHTML="正确";
			  istrue=true;
			}
		}
	</script>
</head>

<body>

<!-- 模态框（Modal）（登陆） -->
<div class="modal fade" id="login" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
	   <div class="modal-dialog">
		  <div class="modal-content">
			 <div class="modal-header">
				<button type="button" class="close" 
				   data-dismiss="modal" aria-hidden="true">
					  &times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
				   登陆
				</h4>
			 </div>
			 <!--登陆主体 -->
			 <div class="modal-body">
			   <form action="{:U('Login/dologin')}" method="POST" role="form" >
				<table class="table">
					<tr>
						<th>用户名:</th><td><input type="text" name="stunum" 
						class="form-control" 
						placeholder="学号"></td>
					</tr>
					<tr>
						<th>密码:</th><td><input type="password" name="pass" 
						class="form-control"
						placeholder="password"></td>
					</tr>
				</table>
				<input type="submit" name="sub" class="btn-block btn-lg btn-primary" value="登陆">
			</form>
			 </div>
		  </div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>

<!-- 模态框（Modal）（注册） -->
<div class="modal fade" id="register" tabindex="-1" role="dialog" 
   aria-labelledby="myModalLabel" aria-hidden="true">
	   <div class="modal-dialog">
		  <div class="modal-content">
			 <div class="modal-header">
				<button type="button" class="close" 
				   data-dismiss="modal" aria-hidden="true">
					  &times;
				</button>
				<h4 class="modal-title" id="myModalLabel">
				   请填写注册信息
				</h4>
			 </div>
			 <!--登陆主体 -->
			 <div class="modal-body">
		<form role="form" action="{:U('register')}" method="post" enctype="multipart/form-data">
	<table class="table">
		<tr>
		<th>上传头像</th>
		<td><input type="file" name="yjl_photo" id="inputfile"></td>
		</tr>
		<tr>
		<th>昵称</th>
		<td> <input type="text" name="yjl_username" class="form-control" id="name" 
			 placeholder="请输入名称" >
		</td>
		</tr>
		<tr>
		<th>姓名</th>
		<td> <input type="text" name="yjl_realname" class="form-control" id="name" 
			 placeholder="请输入名称" >
		</td>
		</tr>
		<tr>
		<th>学号</th>
		<td> <input type="text" name="yjl_stunum" class="form-control" id="stunnum" 
			 placeholder="请输入名称" >
		</td>
		</tr>
		<tr>
		<th>密码</th>
		<td> <input type="password" id="pwd" name="yjl_pass" class="form-control" id="name" 
			 placeholder="请输入名称">
		</td>
		</tr>
		<tr>
		<th>重复密码</th>
		<td> <input type="password" name="repass" id="rpwd" class="form-control" required="required" placeholder="password"
					onblur="test()" required oninvalid="setCustomValidity('请再次填写密码')"
					oninput="setCustomValidity('')">
		<td>
		<p id="clogodiv">						
		</p>
		</td>
		</tr>
		<tr>
		<th>邮箱</th>
		<td> <input type="email" name="yjl_email" class="form-control" id="name" 
			 placeholder="请输入名称" >
		</td>
		</tr>
			<tr>
		<th>电话</th>
		<td> <input type="text" name="yjl_tele" class="form-control" id="name" 
			 placeholder="请输入名称" >
		</td>
		</tr>
	</table>
	<div id="pageButton">
		<span id="left">
		<button type="button" class="btn btn-default" 
               data-dismiss="modal">关闭
            </button>
		</span>
		<span id="right">
            <button type="submit" class="btn btn-primary">
               注册
            </button>
		</span>
    </div>
	 </form>
	 </div>
	</div><!-- /.modal-content -->
	</div><!-- /.modal -->
</div>


<div id="content">
    <!-- Navigation -->
    <nav class="navbar navbar-default navbar-fixed-top topnav" role="navigation">
        <div class="container topnav">
            <!-- Brand and toggle get grouped for better mobile display -->
            <div class="navbar-header">
                <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1">
                    <span class="sr-only">Toggle navigation</span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand topnav" href="{:U('Index/index')}">创新空间</a>
            </div>
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
                <ul class="nav navbar-nav navbar-right">
                    <li>
                        <a href="{:U('news')}">新闻</a>
                    </li>
                    <li>
                        <a href="{:U('practices')}">活动</a>
                    </li>
                    <li>
                        <a href="{:U('groups')}">团体</a>
                    </li>
				<?php 
					if(isset($_SESSION['user'])){
						$flag=$_SESSION['user']['yjl_username'];
					}
				?>
				
				<empty name="flag">
				<li><a href='#' data-toggle='modal'  data-target='#login'>登录</a>
                    </li>
                    <li>
                        <a href='#' data-toggle='modal'  data-target='#register'>注册</a>
                    </li>
				<else/>
					<li><a href="__ROOT__/profile.php/Profile/index">{$flag}欢迎使用</a>
                    </li>
                    <li>
                        <a href='{:U('Login/logout')}' >注销</a>
                    </li>
				</empty>
                </ul>
            </div>
            <!-- /.navbar-collapse -->
        </div>
        <!-- /.container -->
</nav>